package com.sky.controller.user;

import com.sky.constant.RedisConstant;
import com.sky.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/shop")
public class UserShopController {

      @Autowired
    StringRedisTemplate stringRedisTemplate;
      /**
       * 店铺的营业状态
       * */
    @GetMapping("/status")
    public Result getStatus(){
        String s = stringRedisTemplate.opsForValue().get(RedisConstant.SHOP_STATUS);
        Integer i = Integer.parseInt(s);
        return Result.success(i);
    }
}
